<template>
  <div>
    vuex学习
  </div>
  <hr>
  vuex中的num：{{ store.state.count }}
  <button @click="store.state.count+=3">num+3</button>
  <button @click="numadd3">num+3-函数中</button>
  <hr>
  <Ch1Com/>
</template>

<script setup>
import Ch1Com from './coms/Ch1Com.vue';

import {useStore} from 'vuex';
const store = useStore()
// console.log(store);
console.log('直接读取count',store.state.count);


const numadd3=()=>{
  store.state.count+=3;
}
</script>

<style lang="scss" scoped>

</style>